package com.wlr.study;

/**
 * @author lrwang
 * @version 1.0
 * @date 2022/3/17 10:42
 */
public class Test {

    public static int find(int[] array, int target) {
        int middle = 0, low = 0, high = array.length - 1;

        if (target < array[low] || target > array[high] || array.length == 0) {
            return -1;
        }
        while (low <= high) {
            middle = (low + high) / 2;
            if (array[middle] > target) {
                high = middle - 1;
            } else if (array[middle] < target) {
                low = middle + 1;
            } else {
                return middle;
            }
        }
        return -1;
    }


    public static void main(String[] args) {
        double result = 2;
        System.out.println(1/result);
    }
}
